﻿
using System.Text;

namespace SharpDepend
{
    public interface IEnviromentStatistics
    {
        int CPUSpeed { get; }

        long TotalMemory { get; }

        long AppMemoryUsed { get; }

        int CPUProcessors { get; }

        string Device { get; }

        double ScaleFactor { get; }
    }

    public static class MyClass
    {
        private static StringBuilder mSB = new StringBuilder();

        public static string Report(this IEnviromentStatistics _this)
        {
            mSB.Clear();

            mSB.AppendLine("AppMemoryUsed: " + ToMemoryString(_this.AppMemoryUsed));
            mSB.AppendLine("TotalMemory: " + ToMemoryString(_this.TotalMemory));
            mSB.AppendLine("CPUSpeed: " + _this.CPUSpeed);
            mSB.AppendLine("CPUProcessors: " + _this.CPUProcessors);
            mSB.AppendLine("Device: " + _this.Device);

            return mSB.ToString();
        }

        private static string ToMemoryString(long bytes)
        {
            return (bytes / 1024 / 1024) + " Mb";
        }
    }

    public interface IEnviromentStatisticsManager
    {
        IEnviromentStatistics EnviromentStatistics { get; }
    }
}
